package com.ruoyi.community.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.community.mapper.SysCommodityMapper;
import com.ruoyi.community.domain.SysCommodity;
import com.ruoyi.community.service.ISysCommodityService;

/**
 * 商品栏Service业务层处理
 * 
 * @author zzx
 * @date 2022-06-07
 */
@Service
public class SysCommodityServiceImpl implements ISysCommodityService 
{
    @Autowired
    private SysCommodityMapper sysCommodityMapper;

    /**
     * 查询商品栏
     * 
     * @param commodityId 商品栏主键
     * @return 商品栏
     */
    @Override
    public SysCommodity selectSysCommodityByCommodityId(Long commodityId)
    {
        return sysCommodityMapper.selectSysCommodityByCommodityId(commodityId);
    }

    /**
     * 查询商品栏列表
     * 
     * @param sysCommodity 商品栏
     * @return 商品栏
     */
    @Override
    public List<SysCommodity> selectSysCommodityList(SysCommodity sysCommodity)
    {
        return sysCommodityMapper.selectSysCommodityList(sysCommodity);
    }

    /**
     * 新增商品栏
     * 
     * @param sysCommodity 商品栏
     * @return 结果
     */
    @Override
    public int insertSysCommodity(SysCommodity sysCommodity)
    {
        return sysCommodityMapper.insertSysCommodity(sysCommodity);
    }

    /**
     * 修改商品栏
     * 
     * @param sysCommodity 商品栏
     * @return 结果
     */
    @Override
    public int updateSysCommodity(SysCommodity sysCommodity)
    {
        return sysCommodityMapper.updateSysCommodity(sysCommodity);
    }

    /**
     * 批量删除商品栏
     * 
     * @param commodityIds 需要删除的商品栏主键
     * @return 结果
     */
    @Override
    public int deleteSysCommodityByCommodityIds(Long[] commodityIds)
    {
        return sysCommodityMapper.deleteSysCommodityByCommodityIds(commodityIds);
    }

    /**
     * 删除商品栏信息
     * 
     * @param commodityId 商品栏主键
     * @return 结果
     */
    @Override
    public int deleteSysCommodityByCommodityId(Long commodityId)
    {
        return sysCommodityMapper.deleteSysCommodityByCommodityId(commodityId);
    }
}
